import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;


public class TestStart {
public static void main(String[] args) {
	
	  System.out.println(
      "Copyright 2004, R.G.Baldwin");
try {
Statement stmt;

//Register the JDBC driver for MySQL.
Class.forName("com.mysql.jdbc.Driver");

//Define URL of database server for
// database named mysql on the localhost
// with the default port number 3306.
String url =
"jdbc:mysql://localhost:3306/mysql";

//Get a connection to the database for a
// user named root with a blank password.
// This user is the default administrator
// having full privileges to do anything.
Connection con =
         DriverManager.getConnection(
                     url,"root", "cisco");

//Display URL and connection information
System.out.println("URL: " + url);
System.out.println("Connection: " + con);

//Get a Statement object
stmt = con.createStatement();

//stmt.executeUpdate(
//"CREATE DATABASE JunkDB");

stmt.executeUpdate(
        "GRANT SELECT,INSERT,UPDATE,DELETE," +
        "CREATE,DROP " +
        "ON studienarbeit.* TO 'admin'@'localhost' " +
        "IDENTIFIED BY 'cisco';");
con.close();
}catch( Exception e ) {
  e.printStackTrace();
}//end catch
	
	
}
}
